<?php
//物业注册
namespace App\Http\Controllers\Home;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\DB;


class ProregisterController extends Controller{

	public function index(){
		return view('home/register.proregister');
	}

	public function proregion(Request $request){

		// dd($request->all());die;
		$password = Hash::make($request->pro_pwd);
		$password = md5($request->pro_pwd.'salt');

    	$showtime=time();

    	$result = DB::table('property')->insert([
			'pro_name'  => $request->pro_name,
			'pro_pwd'   => $password,
			'pro_email' => $request->pro_email,
			'pro_tel'   => $request->pro_tel,
			'pro_address' => $request->pro_address,
			'pro_creat_time' => "$showtime"
    	]);

    	if($result){
    		return 1;
    	}
	}

}